<template>
    <div>
      <listPage
      ref="listPageRef"
      pageTitle="参数管理"
      :btnList="btnList"
      :addBtnList="addBtnList"
      :tableData="tableData"
      :allColumn="tableColumn"
      :tableColumn="showColumn"
      @setColumn="(val)=>{showColumn=val}"
      ></listPage>
    </div>
  </template>
  
  <script>
    import listPage from '@/components/listPage'
    import {getConCluster} from '@/api/pageList'
  
    export default {
      data() {
        return {
          addBtnList:[],
          btnList:[],
          showLog: false, // 控制台弹窗
          logValue: null, // 控制台值
          editValue: null, // 编辑值
          showEdit: false, // 编辑弹窗
          showColumn: [], // 展示列
          tableColumn: [{
              field: "name",
              label: "参数名称",
            },
            {
              field: "aaa",
              label: "已选参数模板名称",
            },
            {
              field: "bbb",
              label: "比较参数模板名称",
            },
          ],
          tableData: [],
        }
      },
      components: {
        listPage
      },
      created() {
        this.init()
      },
      methods: {
        init(){
          this.showColumn = this.tableColumn
          this.getData()
        },
        getData(params={}){
        //   console.log('~~~~~~~~~',params)
        //   // 请求
        //   getConCluster().then(res => {
        //     if(res.code==200){
        //       let data = JSON.parse(res.data)
        //       this.tableData = data
        //       console.log('~~~~~~',this.tableData);
        //     }
        //   })
          this.$nextTick(()=>{
              this.tableData = [
                {name:'binlog_transaction_dependency_history_size',aaa:'500000',bbb:'-'},
                {name:'binlog_transaction_dependency_history_size',aaa:'500000',bbb:'-'},
                {name:'binlog_transaction_dependency_history_size',aaa:'500000',bbb:'-'},
                {name:'binlog_transaction_dependency_history_size',aaa:'500000',bbb:'-'},
                {name:'binlog_transaction_dependency_history_size',aaa:'500000',bbb:'-'},
                {name:'binlog_transaction_dependency_history_size',aaa:'500000',bbb:'-'},
                {name:'binlog_transaction_dependency_history_size',aaa:'500000',bbb:'-'},
                {name:'binlog_transaction_dependency_history_size',aaa:'500000',bbb:'-'},
                {name:'binlog_transaction_dependency_history_size',aaa:'500000',bbb:'-'},
              ]
          })
        },
        handleAdd() {
          console.log('跳转新增页');
          // this.$router.push({
          //   path: '/physical/physicalMachineAdd'
          // })
        },
        selectedData(){
          return this.$refs.listPageRef.getSelectedData()
        },
        handleClick(name) {
          this.tipName = name
          // 获取选中数据
          let selectRow = this.selectedData()
          console.log('@@@@@@',)
          this.showTip = true
  
          // this.$axios.get('http://47.95.194.212:6601/api/physical').then(res=>{
          //   console.log('@@@@@',res)
          // })
        },
        handleccc() {
          console.log('6666666666666');
        },
        setTable() {
          this.$refs.settingTable.init()
        },
        handleLog(index, row) {
          console.log(index, row);
          this.showLog = true
        },
        handleEdit(index, row) {
          console.log(index, row);
          this.showEdit = true
        },
        handleDetail(index, row) {
          console.log(index, row);
        },
      }
    }
  </script>
  
  <style scoped lang="less">
    .edit-dialog {
      margin: 0px 20px 10px;
      display: flex;
      // align-items: center;
      .name {
        min-width: 80px;
        font-weight: 650;
        font-size: 16px;
        color: rgba(0, 0, 0, 0.847058823529412);
        margin-right: 35px;
      }
      .el-input {
        width: 233px;
      }
    }
  </style>
  